<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>轮播图</title>
    <style>
        .slider {
            width: 600px;
            height: 800px;
            overflow: hidden;
            position: relative;
        }
        .slider img {
            width: 100%;
            height: 100%;
            display: none;
        }
        .slider img.active {
            display: block;
        }
    </style>
</head>
<body>
    <div class="slider">
        <img src="https://ww4.sinaimg.cn/mw690/69b2b15dgy1hjo09k6li9j20yi1frhdt.jpg" alt="图片1" class="active">
        <img src="https://pic2.zhimg.com/50/v2-1d9c4086eaf2eb5d78b1ffbc3b1b0502_hd.jpg?source=1940ef5c" alt="图片2">
        <img src="https://gd-hbimg.huaban.com/950d4c6f003f0d176df37a46c1d5c1817c6a72963666e0-hT6h4a_fw658" alt="图片3">
    </div>
    <script>
        var images = document.querySelectorAll('.slider img');
        var currentIndex = 0;
        function changeImage() {
            images[currentIndex].classList.remove('active');
            currentIndex = (currentIndex + 1) % images.length;
            images[currentIndex].classList.add('active');
        }
        setInterval(changeImage, 3000);
    </script>
</body>
</html>